package com.cjhedu.web.mapper;

import com.cjhedu.web.domain.Dept;
import com.cjhedu.web.domain.Emp;
import com.cjhedu.web.dto.EmpDto;
import com.cjhedu.web.dto.EmpLogDto;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import javax.swing.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 陈佳豪
 * @version 1.0
 */
@Mapper
public interface EmpMapper {

    //分页查询
    //@Select("select * from emp limit #{start},#{pageSize}")
    //public List<Emp> getByPage(@Param("start") Integer start, @Param("pageSize") Integer pageSize);
    //
    ////统计条数
    //@Select("select count(*) from emp")
    //public Long getTotal();

    //分页查询 不带条件
    //@Select("select * from emp")
    //public List<Emp> getByPage();

    //分页查询 带条件
    public List<Emp> getByPage(EmpDto empDto);

    //根据id删除/批量删除
    public int del(Integer[] ids);

    //添加员工
    @Insert("insert into emp values (null,#{username},#{password},#{name},#{gender},#{image},#{job},#{entrydate},#{deptId},#{createTime},#{updateTime})")
    public int addEmp(Emp emp);

    //回显员工信息
    @Select("select * from emp where id = #{id}")
    public Emp getById(Integer id);

    //修改员工
    public int update(Emp emp);

    //员工登录
    @Select("select * from emp where username=#{username} and password=#{password}")
    public Emp login(EmpLogDto empLogDto);
    //删除
    //public int deleteById(Integer id);

    //删除
    //public Emp selectById(Integer id);

    //public  List<Emp> selectAll();




    //public  int updateEmp(Integer id);

    //添加

    //public int addEmp(Emp emp);
}
